package com.online.onlineshop.services;

import com.online.onlineshop.entity.Production;
import com.online.onlineshop.utils.ReturnData;
import com.online.onlineshop.vo.SalesVolumeParamVo;
import com.online.onlineshop.vo.SalesVolumeVo;

import java.util.List;

public interface ForProductionService {

    /**
     * 搜索全部商品并分页
     * @return
     */
    ReturnData<List<Production>> listAll(int pageNum, int limit);

    /**
     * 按名称模糊查询
     * @param name
     * @param pageNum
     * @param limit
     * @return
     */
    ReturnData<List<Production>> selectByName(String name, int pageNum, int limit);

    /**
     * 按对象参数查询并分页
     * @param production
     * @param pageNum
     * @param limit
     * @return
     */
    ReturnData<List<Production>> selectByProduction(Production production, int pageNum, int limit, int uid);

    ReturnData<String> addProduction(int uid, String userName, Production production);

    ReturnData<String> updateByPid(String name, Production production);

    /**
    * 排序热点商品方法
    */
    List<Production> selectHotList();

    /**
     * 排序时间商品方法
     */
    List<Production> selectNewList();

    /**
     *
     * @param pid  商品id
     * @return
     */
    Production selectByPid(int pid);

    ReturnData<String> deleteByPid(int pid);

    ReturnData<List<Production>> selectByProduct(Production production, int pageNum, int limit);

    ReturnData<List<SalesVolumeVo>> selectSalesVolumeById(SalesVolumeParamVo vo, int uid, int pageNum, int limit);
}
